package com.itboye.textlieexpters.webview;

import java.util.List;

import com.itboye.textileexpes.beans.ForresterBeans;
import com.itboye.textileexpres.R;
import com.itboye.textileexpres.util.MyToast;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class GridVIewAdapter extends BaseAdapter{
 List<ForresterBeans> list;
 Context context;
 public GridVIewAdapter(List<ForresterBeans> list, Context context) {
	// TODO Auto-generated constructor stub
	 this.list=list;
	 this.context=context;
}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		
	 View view = LayoutInflater.from(context).inflate(
                R.layout.item_city, null);
	 TextView view2=(TextView) view.findViewById(R.id.name);
	 int lenth=list.get(position).getSubProp().size();
	 for (int i = 0; i < lenth; i++) {
		 String name=list.get(i).getSubProp().get(i).getPropName();
		 MyToast.toast(name);
		view2.setText(name);
	}
		return view;
	}

}
